<section class="content-header">
    <ol class="breadcrumb">
        <li><a href="/dashboard"><i class="fa fa-dashboard"></i> 管理中心</a></li>
        <li class="active">文章管理</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-header with-border">
                    <h3 class="box-title">文章列表</h3>
                    <div class="btn-group  pull-right" role="group">
                        <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"
                                aria-haspopup="true" aria-expanded="false">
                            <i class="fa fa-edit"></i> 发表文章
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu">
                            <li>
                                <a href="/dashboard/p/create" class=""><span>发表原创</span></a>
                            </li>
                            <li><a href="/dashboard/p/create-share">发表分享</a></li>
                        </ul>
                    </div>
                </div>
                <div class="box-body">
                    <table class="table table-striped table-hover">
                        {{#each articles}}
                            <tr>
                                <td width="50">
                                    {{#equals type '原创'}}
                                        <span class="label label-info">原创</span>
                                    {{/equals}}
                                    {{#equals type '分享'}}
                                        <span class="label label-warning">分享</span>
                                    {{/equals}}
                                </td>
                                <td data-toggle="hover" data-target="hover{{_id}}" style="height: 60px;">
                                    {{#if recommend}}
                                        <span class="label label-success">已推荐</span>
                                    {{/if}}
                                    {{#if up}}
                                        <span class="label label-primary">已置顶</span>
                                    {{/if}}
                                    <a href="/p/{{_id}}" target="_blank" class="font16">{{title}}</a>

                                    <div class="hide" id="hover{{_id}}">
                                        <a href="/dashboard/p/delete/{{_id}}" data-toggle="confirm"
                                           data-message="确认要删除此文章吗" class="text-danger">删除</a>
                                        {{#equals type '原创'}}
                                            |
                                            <a href="/dashboard/p/edit/{{_id}}">编辑</a>
                                        {{/equals}}
                                        |
                                        <a href="/dashboard/p/up/{{_id}}?up={{up}}">置顶</a>
                                        |
                                        <a href="/dashboard/p/recommend/{{_id}}?recommend={{recommend}}">推荐</a>

                                    </div>
                                </td>
                                <td width="160">{{formatDate created_time 'yy.MM.dd hh:mm'}}</td>
                            </tr>
                        {{/each}}
                    </table>
                </div>
            </div>
        </div>
    </div>
</section>
